package com.yuanfeng.job.mapper;

import com.yuanfeng.job.dto.PromotionDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName PromotionMapper
 * @Description 晋升
 * @Author liulh
 * @Date 2023/5/17 9:54
 * @Version 1.0
 **/
@Mapper
public interface PromotionMapper {

    /**
     * 获取会员等级删除了的用户
     *
     * @return
     */
    List<PromotionDTO> getPromotionByOrder();

    /**
     * 获取等级Id
     *
     * @param userIntegral
     * @return
     */
    Integer getGradeIdByUserIntegral(@Param("userIntegral") Integer userIntegral);

    /**
     * 更新等级
     *
     * @param userId
     * @param gradeId
     */
    void updateGradeId(@Param("gradeId") Integer gradeId, @Param("userId") String userId);

    Integer getUserIntegralByOrder(@Param("userId") String userId);
}
